package com.momo.common.req.sysSetting;

import com.momo.common.error.BaseReq;
import com.momo.mapper.dataobject.RoutesDO;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;


/**
 * Created by MOMO on 2019/2/27.
 */
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class RouteReq extends BaseReq {
    private Integer pId;
    private String id;
    private String predicates;
    private String sysName;
    private String filters;
    private String uri;
    private Integer order;

    public static RouteReq route(RoutesDO routesDO) {
        RouteReq routeReq = RouteReq.builder().id(routesDO.getSysId()).filters(routesDO.getSysFilters())
                .order(routesDO.getSysOrder()).pId(routesDO.getPId()).predicates(routesDO.getSysPredicates())
                .uri(routesDO.getSysUri()).build();
        return routeReq;
    }


}
